<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>个人中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Hosting Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>

    <%--<link href="${pageContext.request.contextPath}/static/admin/assets/css/minimal.css" rel="stylesheet"/>--%>
    <link href="${pageContext.request.contextPath}/static/home/css/bootstrap.css" rel='stylesheet' type='text/css' />

    <script src="${pageContext.request.contextPath}/static/home/js/jquery-1.11.1.min.js"></script>
    <!-- Custom Theme files -->
    <!-- Custom Theme files -->
    <link href="${pageContext.request.contextPath}/static/home/css/style.css" rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/chosen/css/chosen.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/chosen/css/chosen-bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/css/dataTables.bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/css/ColVis.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/css/TableTools.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/videobackground/css/jquery.videobackground.css">
    <!-- webfonts -->
    <link href='${pageContext.request.contextPath}/static/home/css/font-awesome.css' rel='stylesheet' type='text/css'/>
    <!-- webfonts -->
    <!-- dropdown -->
    <script src="${pageContext.request.contextPath}/static/home/js/jquery.easydropdown.js"></script>

    <link href="${pageContext.request.contextPath}/static/home/css/nav.css" rel="stylesheet" type="text/css" media="all"/>
    <link href="${pageContext.request.contextPath}/static/admin/css/sweetalert.css" rel="stylesheet">

    <link href="${pageContext.request.contextPath}/static/home/css/resume_manage.css" rel='stylesheet' type='text/css' />
    <link href="${pageContext.request.contextPath}/static/home/css/company_style.css" rel='stylesheet' type='text/css' />
    <!-- start-smoth-scrolling -->
    <script src="${pageContext.request.contextPath}/static/admin/js/sweetalert.min.js"></script>
    <!-- start-smoth-scrolling -->
    <!-- webfonts -->
    <%--<link href='http://fonts.useso.com/css?family=Ubuntu:300,400,500,700' rel='stylesheet' type='text/css'>--%>
    <!-- webfonts -->
    <!-- start-smoth-scrolling -->
    <link href="${pageContext.request.contextPath}/static/admin/assets/css/vendor/bootstrap/bootstrap.min.css" rel="stylesheet"/>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/home/css/bootstrap-checkbox.css">
    <link href="${pageContext.request.contextPath}/static/home/css/job_management_table.css" rel="stylesheet">
    <style>
        .col-md-3 {
            width: 20% !important;
        }

        .bg-transparent-white-2 {
            background-color: rgba(255, 255, 255, 0.2) !important;
            color: #000;
        }
    </style>
</head>
<!-- Header Starts Here -->
<div class="banner inner-banner" >
    <%@include file="../header.jsp"%>

    <div id="breadcrumb_wrapper">
        <div class="container">

            <h3><strong>简历状态</strong></h3>
            <h6>&nbsp;</h6>

            <div class="clearfix"></div>
        </div>
    </div>
</div>
<div class="clearfix"> </div>
<!-- Header Ends Here -->

<!--Main Starts Here-->
<div class="contact">
    <div class="container">

        <div class="main-table" style="margin-top: 5%">
            <ul class="nav nav-tabs nav-table" role="tablist">
                <li role="presentation" class="active">
                    <a href="#home" aria-controls="home" data-toggle="tab" >
                        申请记录
                    </a>
                </li>
                <li role="presentation"><a href="#invite" aria-controls="pass" data-toggle="tab">邀请记录</a></li>
                <li role="presentation"><a href="#notice" aria-controls="interview" data-toggle="tab">HR通知</a></li>
            </ul>
        </div>

        <div class="tab-content">

            <div class="tile-body color transparent-black rounded-corners tab-pane fade in active " id="home">

                <div class="table-responsive">
                    <table  class="table table-datatable table-custom basicDataTable">
                        <thead>
                        <tr>
                            <th class="no-sort">申请公司</th>
                            <th class="no-sort">申请职位</th>
                            <th class="sort-numeric">申请时间</th>
                            <th class="sort-alpha">简历状态</th>
                            <th class="no-sort">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>

            </div>
            <div class="tile-body color transparent-black rounded-corners tab-pane fade" id="invite">

                <div class="table-responsive">
                    <table  class="table table-datatable table-custom basicDataTable" >
                        <thead>
                        <tr>
                            <th class="no-sort">公司</th>
                            <th class="no-sort">职位</th>
                            <th class="no-sort">邀请时间</th>
                            <th class="sort-numeric">工资</th>
                            <th class="no-sort">工作地点</th>
                            <th class="no-sort">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>

            </div>

            <div class="tile-body color transparent-black rounded-corners tab-pane fade" id="notice">

                <div class="table-responsive">
                    <table  class="table table-datatable table-custom basicDataTable" >
                        <thead>
                        <tr>
                            <th class="no-sort">公司</th>
                            <th class="no-sort">职位</th>
                            <th class="no-sort">申请时间</th>
                            <th class="sort-numeric">工资</th>
                            <th class="no-sort">工作地点</th>
                            <th class="no-sort">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>

            </div>


            <div class="tile-footer bg-transparent-white-2 rounded-bottom-corners">
                <div class="row">

                    <div class="col-sm-offset-4 col-sm-4 text-center">
                        <small class="inline table-options paging-info"></small>
                    </div>

                    <div class="col-sm-4 text-right sm-center">
                        <ul class="pagination pagination-xs nomargin pagination-custom">

                        </ul>
                    </div>

                </div>
            </div>
        </div>

        <input type="hidden" id="select_num" value="1">
    </div>
</div>
<!--Main Ends Here-->

<table id="table_td_temp" style="display:none">
    <tbody id="template-list-tbody">
    <tr class="odd gradeA">
        <td>日天大队长</td>
        <td>10</td>
        <td>0</td>
        <td>2016-01-02</td>
        <td class="td4">dae</td>
        <td class="actions">
            <a href="#" class="detail">详情 </a>
        </td>
    </tr>
    </tbody>
</table>

<!-- #Footer -->
<%@include file="../footer.jsp"%>
<!-- /#Footer -->
<!-- here stars scrolling icon -->
<script type="text/javascript" src="${pageContext.request.contextPath}/static/home/js/move-top.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/home/js/easing.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/home/js/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/js/page.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/mmenu/js/jquery.mmenu.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/sparkline/jquery.sparkline.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/nicescroll/jquery.nicescroll.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/animate-numbers/jquery.animateNumbers.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/videobackground/jquery.videobackground.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/blockui/jquery.blockUI.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/bootstrap/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/ColReorderWithResize.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/colvis/dataTables.colVis.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/tabletools/ZeroClipboard.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/tabletools/dataTables.tableTools.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/datatables/dataTables.bootstrap.js"></script>
<script type="text/javascript">
    jQuery(document).ready(function($) {
        $(".scroll").click(function(event){
            event.preventDefault();
            $('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
        });
    });
</script>
<!-- /#Footer -->
<!-- here stars scrolling icon -->
<script type="text/javascript">
    $(document).ready(function() {
        /*
         var defaults = {
         containerID: 'toTop', // fading element id
         containerHoverID: 'toTopHover', // fading element hover id
         scrollSpeed: 1200,
         easingType: 'linear'
         };
         */

        $().UItoTop({ easingType: 'easeOutQuart' });

    });
</script>

<script>
    $('#myTabs a').click(function (e) {
        e.preventDefault();
        $(this).tab('show');
        console.log(this);
    });

    $('#myTabs a[href="#profile"]').tab('show') // Select tab by name
    $('#myTabs a:first').tab('show'); // Select first tab
    $('#myTabs a:last').tab('show'); // Select last tab
    $('#myTabs li:eq(2) a').tab('show'); // Select third tab (0-indexed)

    $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
        e.target // newly activated tab
        e.relatedTarget // previous active tab
        var str = e.target.href.toString();
        var s = str.substring(str.lastIndexOf('#'));
        console.log(s);
        if (s == "#home"){
            $('#select_num').val('1');
        }
        else if(s == "#invite") {
            $('#select_num').val('2');
        }
        else if(s == "#notice") {
            $('#select_num').val('3');
        }

        console.log($('#select_num').val());
        fetchData();
    });
</script>
<!-- //here ends scrolling icon -->

<script>
    var show = "";
    var fetchData = function (furl) {
        if(furl==null) {
            url = "${pageContext.request.contextPath}/home/customer/getNoticeList.action?p=1";
        }else{
            url = furl;
        }
        var select_num = $('#select_num').val();
        var str = "#home";
        if (select_num == 1){
            str = "#home";
        }
        else if(select_num == 2) {
            str = "#invite";
        }
        else if(select_num == 3) {
            str = "#notice";
        }

        $.ajax({
            type:'get',
            url:url,
            data:'select='+select_num,
            success:function(json){
                console.log(json);
                show = json.show;
                if (show=="" ||show.totalRows == 0) {
                    $(str +" table tbody").html('<tr><td colspan="10" align="center">暂无记录</td></tr>');
                    $('.paging-info').html("showing 0-0 of 0 items");
                    $('.pagination').html("");
                    return;
                } else {
                    var list = json.data;
                    var body = $(str +" table tbody");
                    var temp_body = $('#template-list-tbody');
                    var tds = $('#table_td_temp td');
                    var string = "";
                    for (var i in list) {
                        $("#table_td_temp .detail").attr("href","${pageContext.request.contextPath}/home/customer/jobDetail.action?job_id="+list[i].job.job_id);
                        tds[0].innerHTML = list[i].company.company_name;
                        tds[1].innerHTML = (list[i].job.job_name);
                        tds[2].innerHTML = list[i].date_added_string;
                        if(select_num==1) {
                            console.log(1);
                            tds[3].innerHTML = (list[i].status==0?"待处理":(list[i].status==1?"通过":"不通过"));
                            $('#template-list-tbody .td4').attr("style","display:none");
                        }else{
                            console.log(2);
                            tds[3].innerHTML = list[i].salaryType.value;
                            $('#template-list-tbody .td4').attr("style","");
                            tds[4].innerHTML = list[i].city.zone.name+list[i].city.name;
                        }
                        string += temp_body.html();
                    }
                    body.html(string);
                    if(show.currentPage == show.totalPage){
                        $('.paging-info').html("showing "+(show.startIndex+1)+"-"+show.totalRows+" of "+show.totalRows+" items");
                    }else {
                        $('.paging-info').html("showing "+(show.startIndex+1)+"-"+show.endIndex+" of "+show.totalRows+" items");
                    }
                    make_page(show,'.pagination','?');
                }
            }
        });
    };

    fetchData();

</script>
</body>
</html>
